/**
 *    Copyright (C) 2008, 2009  Victor Smirnov <aist11@gmail.com>
 *
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License along
 *    with this program; if not, write to the Free Software Foundation, Inc.,
 *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *    See LICENSE.exceptions in the root folder of this project for possible
 *    exceptions
 *
 */

#ifndef _CUBEFS_CORE_MODELS_ROOT_MODEL_MAP_API_HPP
#define _CUBEFS_CORE_MODELS_ROOT_MODEL_MAP_API_HPP

#include <cubefs/core/models/root/names.hpp>

#define CUBEFS_SOURCE "cubefs/core/models/root/model/model_api.hpp:" CUBEFS_AT

namespace cubefs    {
namespace ctr       {


CUBEFS_MODEL_PART_BEGIN(cubefs::models::root::MapApiName)
    typedef typename Base::Types                                                Types;
    typedef typename Base::PageMgr                                              PageMgr;

    typedef typename Base::Page                                                 Page;
    typedef typename Base::ID                                                   ID;


    typedef typename Base::NodeBase                                             NodeBase;
    typedef typename Base::Counters                                             Counters;
    typedef typename Base::Iterator                                             Iterator;

    typedef typename Base::NodeDispatcher                                       NodeDispatcher;
    typedef typename Base::RootDispatcher                                       RootDispatcher;
    typedef typename Base::LeafDispatcher                                       LeafDispatcher;
    typedef typename Base::NonLeafDispatcher                                    NonLeafDispatcher;

    typedef typename Base::Node2RootMap                                         Node2RootMap;
    typedef typename Base::Root2NodeMap                                         Root2NodeMap;

    typedef typename Base::NodeFactory                                          NodeFactory;

    typedef typename Base::Key                                                  Key;
    typedef typename Base::Value                                                Value;

    typedef typename Base::ApiKeyType                                           ApiKeyType;
    typedef typename Base::ApiValueType                                         ApiValueType;

    static const Int Indexes                                                    = Base::Indexes;


    virtual bool Remove(cubefs::api::Iterator *iterator) {
        throw CubefsException(CUBEFS_SOURCE, "Operation is not supported for RootMap");
    }

    virtual void Put(Map::Pair* pair) {
        throw CubefsException(CUBEFS_SOURCE, "Operation is not supported for RootMap");
    }

    virtual bool Remove(Map::Pair* pair) {
        throw CubefsException(CUBEFS_SOURCE, "Operation is not supported for RootMap");
    }
    
CUBEFS_MODEL_PART_END

}
}

#undef CUBEFS_SOURCE

#endif //_CUBEFS_CORE_MODELS_ROOT_MODEL_MAP_API_HPP
